feat(installer): read Node task slugs from tasks.json#70
Merged
Conversation
bin/install.js hardcoded TASK_SKILL_SLUGS, duplicating the Python installer's list — the two drifted independently. Read the Task Registry (tasks.json) at install time instead, mirroring tasks.installable_slugs(). Now unblocked: #45 landed tasks.json. - ship tasks.json in npm tarball so packaged installs can read it - add npm test (node:test) + wire node setup into ci.yml - reject registry missing canonical_skill_slug, matching Python Closes #65 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wires the Node installer to the Task Registry so it stops duplicating the Python slug list.
What
bin/install.js: drop hardcodedTASK_SKILL_SLUGS; load slugs fromsrc/codeforerunner/tasks.jsonat install time vialoadTaskSkillSlugs(), mirroring Pythontasks.installable_slugs()(canonical slug first, then per-taskskill_slugin registry order, deduped).fetchRawText()(reused byfetchSkill+ the loader); local-first, HTTPS fallback.package.json: shiptasks.jsonin the npm tarball; addnpm test(node --test)..github/workflows/ci.yml: addsetup-node+npm test; node now precedes pytest (the parity test shells out to it).canonical_skill_slug(matches PythonKeyError).Why
bin/install.jsmirrored the Python list by hand — a live drift hazard. #45 (Task Registry) landed in #66, makingtasks.jsonthe source of truth, so the Node side can now read it.Tests
tests/install.test.js(new, 8node:testbehaviors): parser (canonical-first, dedup, skip-null, order, malformed→throw, missing-canonical→throw), local read, and a subprocess test asserting the CLI exits non-zero when the registry is unreadable.tests/test_installer.py: Node↔Python slug parity (spawns node, skips if absent).Acceptance (#65)
tasks.json, no hardcoded listinstallable_slugs()Follow-up filed: #69 (cap redirects in
fetchRawText).Closes #65